{include file="common/header.tpl"}
<section class="main">	
    <article class="right-col">
    	<h2>{$language.title.section} &raquo; <a href="{$smarty.const.HOST_BACKEND}section/add">{$language.ahref.add}</a></h2>
        {if $arrResult && $intTotal > $intLimit}
            <div class="s-page">
            	<strong class="total">{$intTotal}</strong>                
                {paging total=$intTotal limit=$intLimit offset=$intOffset}
            </div>
        {/if}
        <table width="100%" cellpadding="0" cellspacing="0" border="0" class="list">
            <thead>
                <tr>
                    <th class="firstChild">{$language.label.code}</th>
                    <th>{$language.label.name}</th>
                    <th>{$language.label.role}</th>
                    <th width="80">{$language.label.enabled}</th>
                    {if $AppUI->type == $smarty.const.ROLE_ROOT}
                    	<th width="16">&nbsp;</th>
                    {/if}
                </tr>
            </thead>
            <tbody>
            	{if isset($arrResult)}
                	{foreach item=item from=$arrResult}
                    	<tr>
                        	<td>{$item.code}</td>
                            <td>{$item.name}</td>
                            <td>{$arrType[$item.perm_a]}</td>
                            <td align="center">
                            	{if $item.enabled == 1}
                                	<img src="{$smarty.const.HOST_STATICS}admin/img/ad-accept.png" width="16" height="16" alt="" />
                               	{else}
                                	<img src="{$smarty.const.HOST_STATICS}admin/img/ad-unaccept.png" width="16" height="16" alt="" />
                                {/if}
                            </td>
                            {if $AppUI->type == $smarty.const.ROLE_ROOT}
                            	<td align="center">
                                	<a href="{$smarty.const.HOST_BACKEND}section/edit?sectionid={$item.sectionid}">
                                    	<img src="{$smarty.const.HOST_STATICS}admin/img/ad-edit.png" width="16" height="16" alt="" />
                                  	</a>
                                </td>
                            {/if}
                        </tr>
                    {/foreach}                	
                {/if}
            </tbody>
        </table>
        {if isset($arrResult) && $arrResult && $intTotal > $intLimit}
            <div class="s-page">
            	<strong class="total">{$intTotal}</strong>                
                {paging total=$intTotal limit=$intLimit offset=$intOffset}
            </div>
        {/if}
    </article>
</section>
{include file="common/footer.tpl"}
                
